aboutsummaryrefslogtreecommitdiff
path: root/pages/api/v2/episode/[id].js
diff options
context:
space:
mode:
authorFactiven <[email protected]>2023-10-24 20:27:32 +0700
committerFactiven <[email protected]>2023-10-24 20:27:32 +0700
commit451e4dffd000169e7113aa3275e4acaf7f1fbbbc (patch)
tree035edf0d05e2f6878be745c326935aba3d821636 /pages/api/v2/episode/[id].js
parentUpdate v4.2.1 (diff)
downloadmoopa-4.2.2.tar.xz
moopa-4.2.2.zip
Update v4.2.2v4.2.2
Diffstat (limited to 'pages/api/v2/episode/[id].js')
-rw-r--r--pages/api/v2/episode/[id].js14
1 files changed, 4 insertions, 10 deletions
diff --git a/pages/api/v2/episode/[id].js b/pages/api/v2/episode/[id].js
index 029d131..ea511e6 100644
--- a/pages/api/v2/episode/[id].js
+++ b/pages/api/v2/episode/[id].js
@@ -4,8 +4,8 @@ import appendMetaToEpisodes from "@/utils/appendMetaToEpisodes";
let CONSUMET_URI;
-CONSUMET_URI = process.env.API_URI;
-if (CONSUMET_URI.endsWith("/")) {
+CONSUMET_URI = process.env.API_URI || null;
+if (CONSUMET_URI && CONSUMET_URI.endsWith("/")) {
CONSUMET_URI = CONSUMET_URI.slice(0, -1);
}
@@ -96,13 +96,7 @@ async function fetchConsumet(id) {
async function fetchAnify(id) {
try {
- if (!process.env.API_KEY) {
- return [];
- }
-
- const { data } = await axios.get(
- `https://api.anify.tv/episodes/${id}?apikey=${API_KEY}`
- );
+ const { data } = await axios.get(`https://api.anify.tv/episodes/${id}`);
if (!data) {
return [];
@@ -138,7 +132,7 @@ async function fetchCoverImage(id, available = false) {
}
const { data } = await axios.get(
- `https://api.anify.tv/content-metadata/${id}?apikey=${API_KEY}`
+ `https://api.anify.tv/content-metadata/${id}`
);
if (!data) {